#include <iostream>
using std::cout;
using std::endl;
//一个类中虚函数表可以有多少张？？
class Base1{
public:
    virtual
    void b1(){
        cout << "Base::b1()" << endl;
    }
private:
    long _base1;
};
class Base2{
public:
    virtual
    void b2(){
        cout << "Base2::b2()" << endl;
    }
private:
    long _base2;
};
class Base3{
public:
    virtual
    void b3(){
        cout << "Base3::b3()" << endl;
    }
private:
    long _base3;
};

class D: public Base1, public Base2, public Base3{
public:
    //依然是虚函数
    void b1(){
        cout << "D::b1()" << endl;
    }

private:
    long _d;
};

void test(){
    cout << sizeof(Base1) << endl;
    cout << sizeof(Base2) << endl;
    cout << sizeof(Base3) << endl;
    cout << sizeof(D) << endl;
}

void test2(){
    D d;
    d.b1();
}

int main()
{
    test();
    return 0;
}

